package com.zzyl.controller.customer;

import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.WxLoginDto;
import com.zzyl.service.LoginService;
import com.zzyl.service.WeChatLoginService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/user")
@Api(tags = "微信登录")
public class WeChatLoginController extends BaseController {

    @Autowired
    private WeChatLoginService weChatLoginService;

    @PostMapping("/login")
    @ApiOperation("微信登录")
    public ResponseResult login(@RequestBody WxLoginDto dto){
        LoginVo vo = weChatLoginService.login(dto);
        return success(vo);
    }

}
